============================================================================================================================
Title: Custom Field: Real Name

Version: 1.0

Author: John Briggs

Description:
This modification will provide an additional field to your profile and threads.

Copyright:  2009 John Briggs. All rights reserved.

Compatibility: XMB 1.9.8 SP4

Install Note: Before adding this modification to your forum you should back up all files related to this modification.

License Note: This modification is released under the GPL v3 License. A copy is provided with this software package.

Author Note: This modification is developed and released for use with XMB 1.9.8 SP4 which is provided by XMBGarage.com.

============================================================================================================================
=======
Step 1:
=======
==============================
Go To Admin Panel --> Insert Raw SQL
==============================

==========================
Paste Code Below & Click Submit:
==========================

ALTER TABLE `$table_members` ADD `realname` varchar(75) NOT NULL default '';

============================================================================================================================
=======
Step 2:
=======
===================
Edit File: editprofile.php
===================
==========
Find Code:
==========

    $sig = postedVar('newsig', 'javascript', ($SETTINGS['sightml']=='off'), TRUE, TRUE);

===============
Add Code Below:
===============

    // Custom Field: Real Name Mod Begin
    $newrealname = postedVar('newrealname', 'javascript', TRUE, TRUE, TRUE);
    // Custom Field: Real Name Mod End

==========
Find Code:
==========

$db->query("UPDATE ".X_PREFIX."members SET status='$status',

========================================
Find Code In-Line At End Of Above Query Statement:
========================================

 WHERE username='$user'");

================
Replace Code With:
================

, realname='$realname' WHERE username='$user'");

============================================================================================================================
=======
Step 3:
=======
=================
Edit File: member.php
=================
==========
Find Code:
==========

loadtemplates(

===============
Add Code Below:
===============

loadtemplates(
'member_profile_realname',

==========
Find Code:
==========

                $sig = postedVar('sig', 'javascript', ($SETTINGS['sightml']=='off'), TRUE, TRUE);

===============
Add Code Below:
===============

                // Custom Field: Real Name Mod Begin
                $realname = postedVar('realname', 'javascript', TRUE, TRUE, TRUE);
                // Custom Field: Real Name Mod End

========================
Find Code On 1st Occurrence:
========================

$db->query("INSERT INTO ".X_PREFIX."members (username,

=============================
Find Code In-Line In Above Statement:
=============================

) VALUES ('$username',

================
Replace Code With:
================

, realname) VALUES ('$username',

==================================
Find Code At End Of Above Query Statement:
==================================

)");

================
Replace Code With:
================

, '$realname')");

========================
Find Code On 2nd Occurrence:
========================

$db->query("INSERT INTO ".X_PREFIX."members (username,

=============================
Find Code In-Line In Above Statement:
=============================

) VALUES ('$username',

================
Replace Code With:
================

, realname) VALUES ('$username',

==================================
Find Code At End Of Above Query Statement:
==================================

)");

================
Replace Code With:
================

, '')");

==========
Find Code:
==========

        $emailblock = '';
        if ($memberinfo['showemail'] == 'yes') {
            eval('$emailblock = "'.template('member_profile_email').'";');
        }

===============
Add Code Below:
===============

        // Custom Field: Real Name Mod Begin
        $realnameblock = '';
        if (!empty($memberinfo['realname'])) {
            $memberinfo['realname'] = censor($memberinfo['realname']);
            eval('$realnameblock = "'.template('member_profile_realname').'";');
        }
        // Custom Field: Real Name Mod End

============================================================================================================================
=======
Step 4:
=======
=================
Edit File: memcp.php
=================
==========
Find Code:
==========

        $sig = postedVar('newsig', 'javascript', ($SETTINGS['sightml']=='off'), TRUE, TRUE);

===============
Add Code Below:
===============

        // Custom Field: Real Name Mod Begin
        $newrealname = postedVar('newrealname', 'javascript', TRUE, TRUE, TRUE);
        // Custom Field: Real Name Mod End

==========
Find Code:
==========

$db->query("UPDATE ".X_PREFIX."members SET $pwtxt email='$email',

========================================
Find Code In-Line At End Of Above Query Statement:
========================================

 WHERE username='$xmbuser'");

================
Replace Code With:
================

, realname='$realname' WHERE username='$xmbuser'");

============================================================================================================================
=======
Step 5:
=======
=====================================================
Skip This Part If You DO NOT Want This Field To Display In Viewthread.
=====================================================
===================
Edit File: viewthread.php
===================
==========
Find Code:
==========

            if ($post['location'] != '') {
                $post['location'] = censor($post['location']);
                $location = '<br />'.$lang['textlocation'].' '.$post['location'];
            } else {
                $location = '';
            }

===============
Add Code Below:
===============

            // Custom Field: Real Name Mod Begin
            $realname = '';
            if (!empty($post['realname'])) {
                $post['realname'] = censor($post['realname']);
                $realname = '<br /><strong>'.$lang['realname'].'</strong> '.$post['realname'];
            }
            // Custom Field: Real Name Mod ENd

==========
Find Code:
==========

            $location = '';
            $mood = '';

===============
Add Code Below:
===============

            // Custom Field: Real Name Mod Begin
            $realname = '';
            // Custom Field: Real Name Mod End

============================================================================================================================
=======
Step 6:
=======
=======================
Edit File: lang/English.lang.php
=======================
============================
Add Code To End Of File Above ?>
============================

// Custom Field: Real Name Mod Begin
$lang['realname'] = "Real Name:";
// Custom Field: Real Name Mod End

============================================================================================================================
=======
Step 7:
=======
==========================
Go To Admin Panel --> Templates
==========================
===========================
Edit Template: admintool_editprofile
===========================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[textlocation]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="newlocation" size="25" value="$member[location]" /></td>
</tr>

===============
Add Code Below:
===============

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[realname]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="newrealname" size="25" value="$member[realname]" /></td>
</tr>

============================================================================================================================
=======
Step 8:
=======
==========================
Go To Admin Panel --> Templates
==========================
===========================
Edit Template: member_reg_optional
===========================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[textlocation]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="location" size="25" value="" /></td>
</tr>

===============
Add Code Below:
===============

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[realname]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="realname" size="25" value="" /></td>
</tr>

============================================================================================================================
=======
Step 9:
=======
==========================
Go To Admin Panel --> Templates
==========================
=======================
Edit Template: memcp_profile
=======================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[textlocation]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="newlocation" size="25" value="$member[location]" /></td>
</tr>

===============
Add Code Below:
===============

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[realname]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="newrealname" size="25" value="$member[realname]" /></td>
</tr>

============================================================================================================================
========
Step 10:
========
======================================================
Skip This Step If You DO NOT Want This Field To Display In Viewthread.
======================================================
==========================
Go To Admin Panel --> Templates
==========================
========================
Edit Template: viewthread_post
========================
==========
Find Code:
==========

$location

===============
Add Code Below:
===============

$realname

============================================================================================================================
========
Step 11:
========
==========================
Go To Admin Panel --> Templates
==========================
=======================
Edit Template: member_profile
=======================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]">$lang[textlocation]</td>
<td bgcolor="$THEME[altbg2]">$memberinfo[location]</td>
</tr>

===============
Add Code Below:
===============

$realnameblock

============================================================================================================================
========
Step 12:
========
==========================
Go To Admin Panel --> Templates
==========================
===================================
Create New Template: member_profile_realname
===================================

=====================
Add Code &  Click Submit:
=====================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[realname]</td>
<td bgcolor="$THEME[altbg2]">$memberinfo[realname]</td>
</tr>

============================================================================================================================
Enjoy!